From a6c43865f58280bddd81b78021dccc3343dec2c5 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Fri, 6 Aug 2004 14:11:00 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.3 (41139174iXDl-lRZjxOIIxORO_R1YA) Only fail because we're not a privileged domain after performing all other checks (permissions & valid level). --- linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c index 13b1cfffc2..6cbd6c9336 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/kernel/ioport.c @@ -15,9 +15,6 @@ asmlinkage long sys_iopl(unsigned int new_io_pl) unsigned int old_io_pl = current->thread.io_pl; dom0_op_t op; - if (!(start_info.flags & SIF_PRIVILEGED)) - return -EPERM; - if (new_io_pl > 3) return -EINVAL; @@ -25,6 +22,9 @@ asmlinkage long sys_iopl(unsigned int new_io_pl) if ((new_io_pl > old_io_pl) && !capable(CAP_SYS_RAWIO)) return -EPERM; + if (!(start_info.flags & SIF_PRIVILEGED)) + return -EPERM; + /* Maintain OS privileges even if user attempts to relinquish them. */ if (new_io_pl == 0) new_io_pl = 1; -- 2.30.2